package com.devops.admin.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devops.admin.config.JSONTypeHandlerPg;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.ibatis.type.JdbcType;

/**
 * 导出数据任务
 * @TableName dos_export_data_job
 */
@AllArgsConstructor
@NoArgsConstructor
@TableName(value ="dos_export_data_job")
@Data
@SuperBuilder(toBuilder = true)
public class DOSExportDataJob extends BaseModel {

    /**
     * job名称
     */
    private String name;

    /**
     * job描述
     */
    private String description;

    /**
     * sql
     */
    private String sql;

    /**
     * 收件人邮箱
     */
    private String recipientEmails;

    /**
     * cron表达式
     */
    private String cronExpression;

    /**
     * 是否启用
     */
    private Boolean active;

    /**
     * 数据库id
     */
    private Integer resourceId;

    /**
     * 任务类型 1.发邮件 2.数据采集
     */
    private Integer type;

    /**
     * 批量id
     */
    private Integer batchId;

    /**
     * 参数sql
     */
    private String paramsSql;

    /**
     * 变量
     */
    @TableField(typeHandler = JSONTypeHandlerPg.class, jdbcType = JdbcType.OTHER)
    private Object variables;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}